Method for encoding and decoding image information

ABSTRACT

The present invention relates to a method for encoding and decoding image information and to an apparatus using same, and the method for encoding the image information, according to the present invention, comprises the steps of: generating a recovery block; applying a deblocking filter to the recovery block; applying a sample adaptive offset (SAO) to the recovery block to which the deblocking filter is applied; and transmitting the image information including information on the SAO which is applied, wherein in the step of transmitting, information for specifying bands that cover a scope of a pixel value, to which a band off set is applied, is transmitted when the band offset is applied during the step of applying the SAO.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. application Ser. No.16/715,895, filed on Dec. 16, 2019, now allowed, which is a continuationof U.S. application Ser. No. 15/996,877, filed on Jun. 4, 2018, now U.S.Pat. No. 10,531,126, which is a continuation of U.S. application Ser.No. 15/217,765, filed Jul. 22, 2016, now U.S. Pat. No. 9,992,515, whichis a continuation of U.S. application Ser. No. 14/126,544, filed Dec.30, 2013, now U.S. Pat. No. 9,565,453, which is a National PhaseApplication under 35 U.S.C. § 371 of International ApplicationPCT/KR2012/004692, filed on Jun. 14, 2012, which claims the benefit ofU.S. Provisional Application No. 61/497,045, filed on Jun. 14, 2011, theentire contents of which are hereby incorporated by reference in theirentireties.

TECHNICAL FIELD

The present invention relates to video information compressiontechnology and, more particularly, to a method of applying a SampleAdaptive Offset (SAO) as an in-loop filter.

BACKGROUND ART

A demand for a high-resolution and high-quality video is recentlyincreasing in various application fields. As the resolution and qualityof an image becomes high, the amount of information about the video alsoincreases. Accordingly, when video information is transmitted using amedium, such as the existing wired and wireless broadband lines, andvideo information is stored using the existing storage medium, a costnecessary to send information and a cost necessary to store informationare increased.

Video compression technology with high efficiency may be used in orderto effectively send, store, and play high-resolution and high-qualityvideo information.

In order to increase video compression efficiency, inter-prediction andintra-prediction may be used. In the inter-prediction method, a pixelvalue of the current picture is predicted based on information aboutanother picture. In the intra-prediction method, a pixel value ispredicted using a correlation between pixels within the same picture.

SUMMARY OF INVENTION Technical Problem

An object of the present invention is to provide a method of adaptivelyapplying an SAO in order to improve a video reconstruction effect.

Another object of the present invention is to provide a method ofapplying a band offset by taking intensity, that is, frequency of apixel for each pixel value into consideration.

Yet another object of the present invention is to provide a method oftransferring information for applying a band offset to only valid bandsfrom a video encoder to a video decoder.

Further yet another object of the present invention is to provide amethod of applying a plurality of SAOs in the unit of SAO application.

Still yet another object of the present invention is to provide a methodand apparatus for applying an SAO to chroma pixels in order to improve avideo reconstruction effect.

Technical Solution

An embodiment of the present invention relates to a video informationencoding method, including generating a reconstructed block, applying adeblocking filter to the reconstructed block, applying an SAO to thereconstructed block to which the deblocking filter has been applied, andtransmitting video information including information about the appliedSAO. When a band offset is applied in applying the SAO to thereconstructed block, transmitting the video information may includetransmitting information to specify bands that cover a range of pixelvalues to which the band offset may be applied.

Transmitting the video information may include transmitting informationabout offset values for the bands that cover the range of pixel valuesto which the band offset may be applied along with the information tospecify the bands that cover the range of pixel values to which the bandoffset may be applied.

The information to specify the bands that cover the range of pixelvalues to which the band offset may be applied may include informationto specify a first band, from among the bands that cover the range ofpixel values to which the band offset may be applied.

Furthermore, the information to specify the bands that cover the rangeof pixel values to which the band offset may be applied may includeinformation to specify a last band, from among the bands that cover therange of pixel values to which the band offset may be applied.

The information to specify the bands that cover the range of pixelvalues to which the band offset may be applied may be transmitted in theunit of SAO application.

Another embodiment of the present invention relates to a videoinformation decoding method, including receiving video informationincluding SAO information about an applied SAO, generating areconstructed block based on the received information, applying adeblocking filter to the reconstructed block, and applying an SAO to thereconstructed block to which the deblocking filter has been applied. TheSAO information may include information to specify bands that cover arange of pixel values to which a band offset may be applied, and whenthe band offset is applied in applying the SAO to the reconstructedblock, the band offset may be applied to pixels corresponding to bandsindicted by the information to specify the bands.

The SAO information may include values of offsets for the bands thatcover the range of pixel values to which the band offset may be applied.

The information to specify the bands that cover the range of pixelvalues to which the band offset may be applied may include informationto specify a first band, from among the bands that cover the range ofpixel values to which the band offset may be applied.

Furthermore, the information to specify the bands that cover the rangeof pixel values to which the band offset may be applied may includeinformation to specify a last band, from among the bands that cover therange of pixel values to which the band offset may be applied.

In the information to specify the bands that cover the range of pixelvalues to which the band offset may be applied, the bands that cover therange of pixel values to which the band offset may be applied may bespecified in the unit of SAO application.

Yet another embodiment of the present invention relates to a videoinformation encoding apparatus, including a filter module for applying aSAO to a reconstructed block and an entropy encoding module forperforming entropy encoding on video information including informationabout the SAO applied in the filter module. If a band offset is appliedin the filter module, the SAO information may include information tospecify bands that cover the range of pixel values to which the bandoffset may be applied.

The SAO information may include information about an offset value forthe bands that cover the range of pixel values to which the band offsetmay be applied.

The information to specify the bands that cover the range of pixelvalues to which the band offset may be applied may include informationto specify a first band, from among the bands that cover the range ofpixel values to which the band offset may be applied.

Furthermore, the information to specify the bands that cover the rangeof pixel values to which the band offset may be applied may includeinformation to specify a last band, from among the bands that cover therange of pixel values to which the band offset may be applied.

The information to specify the bands that cover the range of pixelvalues to which the band offset may be applied may be transmitted in theunit of SAO application.

Further yet another embodiment of the present invention relates to avideo information decoding apparatus, including an entropy decodingmodule for obtaining video information by performing entropy decoding ona received bitstream and a filtering module for applying a SAO to areconstructed block generated based on the video information. The videoinformation may include information to specify bands that cover a rangeof pixel values to which a band offset may be applied, and when the bandoffset is applied, the filtering unit module the band offset to pixelscorresponding to the specified bands.

The video information may include values of offsets for the bands thatcover the range of pixel values to which the band offset may be applied.

The information to specify the bands that cover the range of pixelvalues to which the band offset may be applied may include informationto specify a first band, from among the bands that cover the range ofpixel values to which the band offset may be applied.

Furthermore, the information to specify the bands that cover the rangeof pixel values to which the band offset may be applied may includeinformation to specify a last band, from among the bands that cover therange of pixel values to which the band offset may be applied.

In the information to specify the bands that cover the range of pixelvalues to which the band offset may be applied, the bands that cover therange of pixel values to which the band offset may be applied arespecified in the unit of SAO application.

Advantageous Effects

According to the present invention, a video reconstruction effect can beimproved by adaptively applying an SAO.

According to the present invention, an amount of information to betransferred can be reduced by applying band offset to valid bands onlyand delivering the information from an encoder to a decoder.

According to the present application a video reconstruction effect canbe improved by applying a plurality of SAOs according to the unit of SAOapplication.

According to the present invention, a video reconstruction effect can beimproved by applying an SAO to chroma pixels.

DESCRIPTION OF DRAWINGS

The accompany drawings, which are included to provide a furtherunderstanding of this document and are incorporated on and constitute apart of this specification illustrate embodiments of this document andtogether with the description serve to explain the principles of thisdocument.

FIG. 1 is a block diagram schematically showing an encoder (or a videoencoder) according to an embodiment of the present invention;

FIG. 2 is a block diagram schematically showing a video decoderaccording to an embodiment of the present invention;

FIG. 3 is a diagram schematically illustrating a band offset;

FIGS. 4A to 4D show local distributions of histograms for the samepicture;

FIGS. 5 to 7 are diagrams schematically illustrating an example of amethod of classifying the entire pixel range adaptively or variably andapplying a band offset;

FIG. 8 is a diagram schematically illustrating an example of a method ofindicating bands to which a band offset may be applied according to thepresent invention;

FIG. 9 is a diagram schematically illustrating another example of amethod of indicating bands to which a band offset will be appliedaccording to the present invention;

FIG. 10 is a diagram schematically illustrating yet another example of amethod of indicating bands to which a band offset will be appliedaccording to the present invention;

FIGS. 11A to 11D show examples of the type of representative edges thatmay appear for each direction within a block;

FIGS. 12A to 12D show four edge types of an edge offset on the basis ofthe current pixel C;

FIGS. 13A to 13F are diagrams schematically illustrating an example inwhich the intensity of the current pixel is compared with the intensityof each of neighboring pixels and the results of the comparison areclassified into four categories;

FIG. 14 is a diagram schematically illustrating the unit of SAOapplication;

FIGS. 15 and 16 are diagrams schematically illustrating examples inwhich a band offset is applied to only some of all bands in relation tochroma pixels;

FIG. 17 is a flowchart schematically illustrating the operation of thevideo encoder in a system to which the present invention is applied; and

FIG. 18 is a flowchart schematically illustrating the operation of thevideo decoder in a system to which the present invention is applied.

MODE FOR INVENTION

The present invention may be modified in various ways and may haveseveral embodiments. Specific embodiments of the present invention areillustrated in the drawings and described in detail in the detaileddescription. However, the present invention is not intended to belimited to the specific embodiments. The terms used in this applicationare used to only describe the specific embodiments and are not intendedto restrict the present invention. An expression of the singular numberincludes an expression of the plural number unless clearly definedotherwise in the context. In this application, terms, such as “comprise”and ‘have”, are intended to designate that characteristics, numbers,steps, operations, elements, or parts which are described in thespecification, or a combination of them exist, and should be understoodthat they exclude the existence or possible addition of one or moreother characteristics, numbers, steps, operations, elements, parts, orcombinations of them in advance.

Meanwhile, elements in the drawings described in the present inventionare independently shown for convenience of description regardingdifferent characteristic functions in a video encoder and a videodecoder, but are not meant that each of the elements is implemented asseparate hardware or separate software. For example, two or more of theelements are merged into one element, and one of the elements may beclassified into a plurality of elements. Embodiments of the integrationof elements and/or the separation of one element fall within the scopeof the present invention unless they do depart from the essence of thepresent invention.

Hereinafter, preferred embodiments of the present invention will bedescribed in detail with reference to the accompanying drawings. Thesame reference numerals designate the same elements throughout thedrawings, and a redundant description of the same elements is omitted.

FIG. 1 is a block diagram schematically showing an encoder (or a videoencoder) according to an embodiment of the present invention. Referringto FIG. 1, the video encoder 100 includes a picture splitting module105, a prediction module 110, a transform module 115, a quantizationmodule 120, a re-arrange module 125, an entropy encoding module 130, adequantization module 135, an inverse transform module 140, a filtermodule 145, and a memory 150.

The picture splitting module 105 may split a received picture in atleast one processing unit. Here, the processing unit may be a PredictionUnit (hereinafter referred to as a ‘PU’), a Transform Unit (hereinafterreferred to as a ‘TU’), or a Coding Unit (hereinafter referred to as a‘CU’).

The prediction module 110, as will be described later, may include aninter-prediction module for performing inter-prediction and anintra-prediction module for performing intra-prediction. The predictionmodule 110 generates a prediction block by performing prediction on theprocessing unit of a picture in the picture splitting module 105. Theprocessing unit of a picture in the prediction module 110 may be the CU,the TU, or the PU. Furthermore, the prediction module 110 may determinewhether prediction performed on a relevant processing unit isinter-prediction or intra-prediction and may determine the details(e.g., a prediction mode) of each prediction method. Here, theprocessing unit and the prediction method on which prediction isperformed may differ from a processing unit on which the detailedcontents of a prediction method are determined. For example, theprediction method, the prediction mode, etc. may be determined in thePU, and prediction may be performed in the TU.

A prediction block may be generated by performing prediction on thebasis of information about at least one of a picture anterior to thecurrent picture and a picture posterior to the current picture throughinter-prediction. Furthermore, a prediction block may be generated byperforming prediction on the basis of information about a pixel withinthe current picture through intra-prediction.

A skip mode, a merge mode, a Motion Vector Prediction (MVP) mode, etc.may be used as the inter-prediction method. In the inter-predictionmethod, a reference picture may be selected for the PU, and a referenceblock having the same size as the PU may be selected. The referenceblock may be selected by an integer pixel unit. Next, a prediction blockhaving a minimum residual signal and a minimum motion vector size for acurrent PU is derived.

The prediction block may be generated in the unit of an integer sampleand may be selected in the unit of an integer pixel or less, such as a ½pixel unit or a ¼ pixel unit. Here, the motion vector may also berepresented in the unit of an integer pixel or less. For example, a lumasample may be represented in the unit of a ¼ pixel, and a chroma samplebe represented in the unit of a ⅛ pixel.

Pieces of information, such as an index of a reference picture, a motionvector (e.g., a motion vector predictor) selected through theinter-prediction, and a residual signal, are subject to entropy encodingand then transferred to a video decoder.

If intra-prediction is performed, the prediction mode may be determinedin the PU and prediction may be performed in the PU. Furthermore, theprediction mode may be determined in the PU, and intra-prediction may beperformed in the TU.

In intra-prediction, the prediction mode may have 33 directionalprediction modes and two or more non-directional modes. Thenon-directional mode may include a DC prediction mode and a planar mode.

In intra-prediction, after a filter is applied to a reference sample, aprediction block may be generated. Here, whether a filter will beapplied to a reference sample may be determined depending on theintra-prediction mode and/or size of the current block.

The PU may have various sizes and forms. For example, in theinter-prediction method, the PU may have a size, such as 2N×2N, 2N×N,N×2N, or N×N (N is an integer), etc. In the intra-prediction method, thePU may have a size, such as 2N×2N or N×N, etc. Here, the PU having thesize N×N may be set so that it is applied to specific cases. Forexample, the PU having the size N×N may be set so that it is applied toa CU having a minimum size or may be set so that it is applied to onlyintra-prediction. Furthermore, in addition to the PUs having the abovesizes, the PU having a size, such as N×mN, mN×N, 2N×mN, or mN×2N (m<1)may be further defined and used.

A residual value (or a residual block or a residual signal) between thegenerated prediction block and an original block is inputted to thetransform module 115. Furthermore, information about the predictionmode, information about the motion vector, etc. which used forprediction, together with the residual value, are encoded by the entropyencoding module 130 and then transferred to a video decoder.

The transform module 115 generates a transform coefficient by performinga transform on the residual block in the unit of a transform. The unitof a transform in the transform module 115 may be the TU, and it mayhave a quad tree structure. Here, the size of the unit of a transformmay be determined within a range of a specific maximum and minimum size.The transform module 115 may transform the residual block by usingDiscrete Cosine Transform (DCT) and/or Discrete Sine Transform (DST).

The quantization module 120 may generate a quantization coefficient byquantizing the residual values transformed by the transform module 115.A value calculated by the quantization module 120 is provided to thedequantization module 135 and the re-arrange module 125.

The re-arrange module 125 re-arranges the quantization coefficientsprovided by the quantization module 120. Encoding efficiency in theentropy encoding module 130 may be improved by re-arranging thequantization coefficients. The re-arrange module 125 may re-arrange thequantization coefficients of a 2-dimensional (2-D) block form in a 1-Dvector form by using a coefficient scanning method. The re-arrangemodule 125 may change order of coefficient scanning on the basis ofprobability statistics of the coefficients transmitted by thequantization module 120 in order to improve entropy encoding efficiencyin the entropy encoding module 130.

The Entropy encoding module 130 may perform entropy encoding on thequantization coefficients re-arranged by the re-arrange module 125.Encoding methods, such as exponential Golomb, Context-Adaptive VariableLength Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding(CABAC), may be used as the entropy encoding. The entropy encodingmodule 130 may encode various pieces of information, such as informationabout a quantization coefficient and the block type of CU, predictionmode information, splitting unit information, PU information andtransmission unit information, motion vector information, referencepicture information, information about the interpolation of a block, andfiltering information which are received from the re-arrange module 125and the prediction module 110.

Furthermore, the entropy encoding module 130 may change a parameter setor syntax to some extent if necessary.

The dequantization module 135 may perform dequantization on the valuesquantized by the quantization module 120, and the inverse transformmodule 140 performs an inverse transform on the values inverselyquantized by the dequantization module 135. The residual valuesgenerated by the dequantization module 135 and the inverse transformmodule 140 and the prediction block predicted by the prediction module110 are added, thereby being capable of generating a reconstructedblock.

An example in which a reconstructed block is generated by adding aresidual block and a prediction block using an adder is shown in FIG. 1.Here, the adder may be considered as an additional unit (i.e., areconstructed block generation unit) for generating the reconstructedblock.

The filter module 145 may apply a deblocking filter, an Adaptive LoopFilter (ALF), and a Sample Adaptive Offset (SAO) to a reconstructedpicture.

The deblocking filter may remove distortion generated at the boundary ofblocks in the reconstructed picture. The Adaptive Loop Filter (ALF) mayperform filtering on the basis of a value obtained by comparing areconstructed picture with an original picture after a block is filteredby the deblocking filter. The ALF may be performed only when highefficiency is used. The SAO is used to restore a difference between areconstructed block to which the deblocking filter has been applied andan original picture in the unit of a pixel, and the SAO is applied inthe form of a band offset or an edge offset.

Meanwhile, the filter module 145 may not apply filtering on areconstructed block used in inter-prediction.

The memory 150 may store the reconstructed block or picture derived bythe filter module 145. The reconstructed block or picture stored in thememory 150 may be provided to the prediction module 110 for performinginter-prediction.

FIG. 2 is a block diagram schematically showing a video decoderaccording to an embodiment of the present invention. Referring to FIG.2, the video decoder 200 may include an entropy decoding module 210, are-arrange module 215, an dequantization module 220, an inversetransform module 225, a prediction module 230, a filter module 235, andmemory 240.

If a VIDEO bitstream is received from a video encoder, the inputtedbitstream may be decoded according to a procedure in which videoinformation has been processed in the video encoder.

For example, if Variable Length Coding (hereinafter referred to as‘VLC’), such as CAVLC, has been used in a video encoder in order toperform entropy encoding, the entropy decoding module 210 may implementthe same VLC table as a VLC table used in the video encoder and performentropy decoding. Furthermore, if CABAC has been used in a video encoderin order to perform entropy encoding, the entropy decoding module 210may perform entropy decoding using CABAC.

Information necessary to generate a prediction block, from among piecesof information decoded by the entropy decoding module 210, is providedto the prediction module 230. A residual value on which entropy decodinghas been performed by the entropy decoding module 210 may be inputted tothe re-arrange module 215.

The re-arrange module 215 may re-arrange bitstreams on which entropydecoding has been performed by the entropy decoding module 210 by usinga method of re-arranging the bitstreams in a video encoder. There-arrange module 215 may re-arrange coefficients represented in a 1-Dvector by restoring the coefficients in coefficients of a 2-D blockform. The re-arrange module 215 receives pieces of information relatedto coefficient scanning performed in a video encoder and may re-arrangethe pieces of information using a method of inversely scanning thepieces of information on the basis of scanning order performed in thevideo encoder.

The dequantization module 220 may perform dequantization on the basis ofa quantization parameter and coefficient values of a re-arranged blockreceived from a video encoder.

The inverse transform module 225 may perform an inverse DCT and/or aninverse DST on a DCT and a DST performed by the transform module of avideo encoder in relation to the results of quantization performed bythe video encoder. An inverse transform may be performed in the unit oftransmission or in the splitting unit of a picture which has beendetermined in the video encoder. In the transform module of a videoencoder, a DCT and/or a DST may be selectively performed based on aplurality of pieces of information, such as a prediction method, thesize of the current block, and a prediction direction. The inversetransform module 225 of the video decoder may perform an inversetransform on the basis of transform information performed in thetransform module of a video encoder.

The prediction module 230 may generate a prediction block on the basisof information about the prediction block provided by the entropydecoding module 210 and information about a previously decoded blockand/or picture provided by the memory 240.

If a prediction mode for the current PU is an intra-prediction mode,intra-prediction for generating the prediction block may be performed onthe basis of information about pixels within the current picture.

If a prediction mode for the current PU is an inter-prediction mode,inter-prediction may be performed on the current PU on the basis ofinformation included in at least one of a picture anterior to thecurrent picture and a picture posterior to the current picture. Here,motion information, for example, a motion vector and information about areference picture index which are necessary for the inter-prediction ofthe current PU and provided by a video encoder may be derived afterchecking a skip flag, a merge flag, etc. received from the videoencoder.

A reconstructed block may be generated by using a prediction blockgenerated by the prediction module 230 and a residual block provided bythe inverse transform module 225. An example in which a reconstructedblock is generated by adding a prediction block and a residual blockusing an adder is illustrated in FIG. 2. Here, the adder may beconsidered as an additional unit (i.e., a reconstructed block generationunit) for generating the reconstructed block.

The reconstructed block and/or picture may be provided to the filtermodule 235. The filter module 235 applies a deblocking filtering, aSample Adaptive Offset (SAO) and/or adaptive loop filtering to thereconstructed block and/or picture.

The memory 240 stores the reconstructed picture and/or block so that itis used as a reference picture and/or a reference block and alsoprovides the reconstructed picture to an output unit.

Meanwhile, as described above, the filter module of each of the videoencoder and the video decoder is an in-loop filter. A deblocking filter,a Sample Adaptive Offset (SAO) filter, an Adaptive Loop Filter (ALF) maybe used as the filter module.

The deblocking filter removes artifacts between blocks according to theprediction, transform, and quantization of a block unit. The deblockingfilter is applied to a PU edge or a TU edge, and it may set a minimumblock size to which the deblocking filter will be applied.

In order to apply the deblocking filter, the Boundary Strength (BS) of ahorizontal or vertical filter boundary is first determined. If whetherfiltering will be performed on the basis of the BS is determined foreach block, what filter is be used may be determined. The filter to beapplied may be a weak filter or a strong filter. The filtering moduleapplies the selected filter to the boundary of a relevant block.

An Adaptive Loop Filter (ALF) may also be applied after an SAO isperformed. The ALF is used to compensate for coding errors by using aWiener filter and is globally applied within a slice unlike the SAO. TheALF may be applied only in case of High Efficiency (HE).

The SAO is a procedure of restoring a difference between a picture onwhich deblocking filtering has been performed and an original picture inthe unit of a pixel. A coding error may be compensated for through theSAO. The coding error may be caused by quantization, etc. As describedabove, the SAO includes two types; a band offset and an edge offset.

FIG. 3 is a diagram schematically illustrating a band offset.

In order to apply a band offset, pixels within the unit of SAOapplication may be classified according to the intensity of each pixel,that is, a pixel value. The intensity range of a pixel, that is, a rangeof pixel values, may be classified into a specific number of intensityintervals (i.e., the interval of pixel values), that is, a specificnumber of bands. (In this specification, terms a ‘pixel value’ and the‘intensity of a pixel’ are used interchangeably for convenience ofdescription. The ‘pixel value’ and the ‘intensity of a pixel’ may beinterpreted as having the same meaning or the ‘pixel value’ may beinterpreted as having a meaning including the ‘intensity of a pixel’). Avalue of an offset applied to each pixel may be set for each band. Anoffset of a band to which a pixel value belongs may be applied to apixel.

Regarding a picture having N bit pixels, the entire pixel range(intensity range) may become 0 to 2^(N)−1. For example, an 8-bit pixelmay have a pixel range of 0 to 255. FIG. 3 illustrates an example inwhich the entire range of pixel values (intensity range) is divided into32 bands having the same interval of pixel values.

Referring to FIG. 3, the intensity interval of each band is 8. The 32bands may be split into a first group at the center and second group onthe sides. If the groups include the same number of bands, the firstgroup may include 16 bands and the second group may include 16 bands. Anoffset is applied to each band, and an offset value for each band may betransmitted to the video decoder.

The video decoder classifies pixels according to the same process asthat of applying a band offset in the video encoder and applies thetransmitted offset value to a pixel depending on a band to which thepixel belongs.

Meanwhile, as described above, a method of adaptively applying a bandoffset may be taken into consideration, instead of the method ofclassifying 32 bands into two groups and setting an offset for eachband. For example, a method of effectively applying a band offset may betaken into consideration by differently setting the interval of a bandto which the band offset will be applied depending on the unit of SAOapplication for applying an SAO, or selectively indicating a band towhich the band offset will be applied, or increasing the number ofgroups to which a band offset to be applied.

A method of adaptively applying a band offset in a system to which thepresent invention is applied is described below.

FIG. 4 shows examples of histograms for a picture according tocharacteristics of the picture. More particularly, FIG. 4 shows variousexamples of histograms of luma and chroma components according to imagecharacteristics for each partial image in a picture of FIG. 4A.

For example, regarding a region A and a region B of FIG. 4A, twohistograms placed on the upper and lower sides on the left side of FIG.4B indicate luma component histograms of original pictures, and twohistograms placed on the upper and lower sides on the right side of FIG.4B indicate luma component histograms of reconstructed pictures.

Regarding the region A and the region B of FIG. 4A, two histogramsplaced on the upper and lower sides on the left side of FIG. 4C indicatechroma (Cr) component histograms of original pictures, and twohistograms placed on the upper and lower sides on the right side of FIG.4C indicate chroma (Cr) component histograms of reconstructed pictures.

Furthermore, regarding the region A and the region B of FIG. 4A, twohistograms placed on the upper and lower sides on the left side of FIG.4D indicate chroma (Cb) component histograms of original pictures, andtwo histograms placed on the upper and lower sides on the right side ofFIG. 4D indicate chroma (Cb) component histograms of reconstructedpictures.

Referring to FIG. 4, it can be seen that different picturecharacteristics are shown depending on regions even within the samepicture and histograms have various distributions depending on thecharacteristics of images for each region. Accordingly, video qualityand compression efficiency can be improved by adaptively applying a bandoffset to a unit region (i.e., an SAO unit) to which an SAO is applied.

The video encoder or the video decoder may adaptively divided a range ofpixel values (a pixel range) and apply a band offset. That is, a rangeof intensity of a pixel (an intensity range of a pixel), which a pixelmay have, may be divided adaptively or variably and a band section maybe set thereon.

For example, if a histogram for an image of a block is concentrated onthe central part of a range of pixel values, bands each having a narrowinterval may be set by further minutely classifying the central part ofrange of pixel values and bands each having a bigger interval may be setby less classifying the side parts of the range of pixel values.

More particularly, regarding a pixel of N bits, if a distribution ofpixels corresponding to the central part of the entire range of pixelvalues (0 to 2^(N)−1) is large, M bands each having a small intensityinterval, that is, a small pixel value interval, may be set in thecentral part, and L bands each having a great intensity interval (i.e.,a great pixel value section) may be set in the side parts of the entirerange of pixel values. Here, M and L may be set to have the same valueor different values.

In contrast, if a histogram for an image of a block is concentrated onthe side parts of the entire range of pixel values, a method of settingbands by further minutely classifying the side parts and setting bandsby less classifying the central part of the entire range of pixel valuesmay be taken into consideration.

More particularly, regarding a pixel of N bits, if a distribution ofpixels corresponding to the side parts of the entire intensity range (0to 2^(N)−1) is large, M bands each having a small intensity interval,that is, a small pixel value section, may be set in the side parts and Lbands each having a great intensity interval (i.e., a great pixel valueinterval) may be set in the central part of the entire intensity range.Here, M and L may be set to have the same value or different values.

FIG. 5 is a diagram schematically illustrating an example of a method ofclassifying the entire range of pixel values adaptively or variably andapplying a band offset. FIG. 5 shows an example in which pixelscorresponding to the central part of the pixel value range (range ofpixel values) are many.

In the example of FIG. 5, assuming that a range of pixel values is 256(0 to 2⁸−1), a first group in the central part of the range of pixelvalues may be minutely divided into 16 bands by using 4 pixel values asone band and second groups in the side parts of the pixel range may bedivided into 12 bands by using 16 pixel values as one band.

Furthermore, if a histogram for an image of a block is concentrated onthe side parts of the entire range of pixel values, unlike in theexample of FIG. 5, the first group in the central part of the range ofpixel values may be divided into 12 bands by using 16 pixel value as oneband and second groups in the side parts of the range of pixel valuesmay be divided into 16 bands by using 4 pixel values as one band.

FIG. 6 is a diagram schematically illustrating another example of amethod of classifying the entire pixel range adaptively or variably andapplying a band offset. FIG. 6 shows an example in which pixelscorresponding to the side parts of the entire pixel value range aremany.

Meanwhile, a method of classifying the entire range of pixel values intomore band groups depending on the SAO application unit withoutclassifying the entre range of pixel values into two band groups may beused. A picture reconstruction effect may be improved because the entirerange of pixel values may be divided more densely and an offset may beapplied. For example, bands are not divided into two groups, but aredivided into N groups so that the video encoder may provide more minuteoffset information to some pixel value ranges. Accordingly, the videodecoder may receive more minute offset information about some pixelvalue range from the video encoder and apply a further minute offsetdepending on a pixel value range.

FIG. 7 is a diagram schematically illustrating yet another example of amethod of classifying a range of pixel values for all pixels adaptivelyor variably and applying a band offset.

The example of FIG. 7 illustrates that the entire range of pixel valuesis divided into a specific number of bands, the bands are divided intofour groups, and a band offset is applied.

For example, in FIG. 7, if N is 8, that is, bits allocated to a pixelvalue is 8 bits, the entire range of pixel values may be 256 values of 0to 255. If the entire range of pixel values is divided into 32 bands andfour groups having the same number of bands are set, each of the groupsincludes 8 bands and each of the bands has a interval of 8 pixel values.

If the entire range of pixel values is divided into more groups not twogroups and information about the offset of each group is transmitted,local characteristics of a picture can be incorporated better.Meanwhile, if a range of pixel values, that is, a range of intensity,covered by each group is fixed when a band offset is applied, relevantinformation is transmitted although the number of times of bandoccurrence within a group (i.e., the number of pixels corresponding to aspecific band or the number of times of offset application correspondingto a specific band) is small or a value of a band offset for a relevantband is 0. In this case, to send the relevant information increases theamount of information transmitted and also the complexity of an overallsystem.

In order to prevent the problems, the video encoder may transmit a rangeof a band offset to be used in the current picture. That is, the videoencoder may transmit a range or interval of bands corresponding to aband offset to be used in the current picture.

More particularly, if a band offset is applied, the video encoder maytransmit information to specify bands that cover a range of pixel valuesto which a band offset may be applied and information about offsetvalues for the bands to the video decoder. The video encoder may specifybands that may cover a range of pixel values to which the band offsetmay be applied or may specify bands that cover only a range of pixelvalues to which the band offset may be applied. Accordingly, informationabout transmitted bands may be information about intervals of bandsincluding bands that cover a range of pixel values to which the bandoffset may be applied or may be information to specify a band intervalthat covers only a range of pixel values to which the band offset may beapplied.

The video decoder receives the information to specify bands that cover arange of pixel values to which the band offset may be applied andinformation about offset values for the bands from the video encoder. Ifa band offset is applied, the video decoder determines whether a pixelvalue of a target pixel belongs to a pixel value range of bands to whichthe band offset may be applied. If, as a result of the determination, itis determined that the pixel value of the target pixel belongs to therange of pixel values of bands to which the band offset may be applied,the video decoder may apply an offset, corresponding to a band to whichthe pixel value of the target pixel belongs, to the target pixel. Sincebands that cover a range of pixel values to which a band offset may beapplied are specified and values of offsets to be applied to only thespecified bands are transmitted, the offset may not be applied to bandsother than the specified bands or a value of the offset for the bandsother than the specified bands may be set to 0.

For example, the video encoder may transfer information, indicatingwhich interval of pixel values the band offset may be applied to in thecurrent picture, to the video decoder. If the offsets of the currentpicture are frequently applied in a specific range of pixel values(e.g., intensities), the video encoder may send information indicatingbands that cover the corresponding range to the video decoder. That is,if a band offset is used in bands having uniform intervals, the firstband at which the application of the band offset begins and the numberof bands to which the band offset may be applied may be specified, alast band at which the application of the band offset ends and thenumber of bands to which the band offset may be applied are designated,or the first band at which the application of the band offset begins andthe last band at which the band offset ends may be specified. In thiscase, information about unnecessary offsets can be prevented from beingtransmitted or unnecessary offsets can be prevented from beingperformed.

FIG. 8 is a diagram schematically illustrating an example of a method ofspecifying or indicating bands to which a band offset may be appliedaccording to the present invention. The example of FIG. 8 illustrates amethod of indicating the first band of bands that cover a range of pixelvalues to which a band offset may be applied.

Referring to FIG. 8, if the number of bands that cover a range of pixelvalues to which a band offset may be applied, from among all N bands, isn, the video encoder sends information indicating the first band, fromamong n bands, to the video decoder.

For example, it is assumed that a band including a pixel value of 0 inthe entire range of pixel values is called a zeroth band and a bandincluding the maximum pixel value in the entire range of pixel values iscalled an (N−1)^(th) band. The video encoder may send informationindicating an i^(th) band, that is, the first band among n bands thatcover a range of pixel values to which a band offset may be applied, andinformation about the offsets for the n bands to the video decoder. Thevideo decoder receives the information indicating the i^(th) band andthe information about the offsets for the n bands from the videoencoder. If the current picture or pixels now within the current SAOapplication unit have a pixel value corresponding to any one of the nbands, and the video decoder may apply the band offset to each of thepixels depending on the pixel value.

In the example of FIG. 8, if the entire range of pixel values is 0 to256 and the number of all bands is 32, the video encoder may indicatethe first band of bands that cover a range of pixel values to which aband offset may be applied, from among a zeroth band to a thirty-firstband. Here, a value of n might have been previously determined betweenthe video encoder and the video decoder. If the number of bands thatcover a range of pixel values to which a band offset may be applied is 4and the first band of the 4 bands is a i^(th) band, the video encodermay send a band offset value for i^(th), (i+1)^(th), (i+2)^(th), and(i+3)^(th) bands, together with information indicating the i^(th) band,to the video decoder.

FIG. 9 is a diagram schematically illustrating another example of amethod of indicating bands to which a band offset may be appliedaccording to the present invention. The example of FIG. 9 illustrates amethod of indicating the last band of bands that cover a range of pixelvalues to which the band offset will be applied.

Referring to FIG. 9, if the number of bands that cover a range of pixelvalues to which a band offset may be applied, from among all N bands, isn, the video encoder sends information specifying the last band of the nbands in all the N bands to the video decoder.

For example, it is assumed that a band including a pixel value of 0 inthe entire pixel range is a zeroth band and a band including the maximumpixel value in the entire range of pixel values is an (N−1)^(th) band.The video encoder may transmit information indicating a j^(th) band,that is, the last band of the n bands that cover a range of pixel valuesto which a band offset may be applied and information about the offsetsfor the n bands to the video decoder. The video decoder receives theinformation indicating the j^(th) band and the information about theoffsets for the n bands from the video encoder. The current picture orpixels now within the SAO application unit have a pixel valuecorresponding to any one of the n bands, and the video decoder may applythe band offset to each of pixels depending on a value of the pixel.

In the example of FIG. 9, if the entire range of pixel values is 0 to256 and the number of all the bands is 32, the video encoder may specifythe last band of the bands that cover a range of pixel values to whichthe band offset may be applied, from among the zeroth band to thethirty-first band. Here, a value of n might have been previouslydetermined between the video encoder and the video decoder. If thenumber of bands that cover a range of pixel values to which a bandoffset may be applied is 4 and the last band of the 4 bands is a j^(th)band, the video encoder may signal a band offset value for j^(th),(j−1)^(th), (j−2)^(th), and (j−3)^(th) bands, together with informationindicating the j^(th) band, to the video decoder.

FIG. 10 is a diagram schematically illustrating yet another example of amethod of specifying bands to which a band offset may be appliedaccording to the present invention. The example of FIG. 10 illustrates amethod of indicating a first band (i.e., a start band) and a last band(i.e., an end band), from among bands that cover a range of pixel valuesto which the band offset may be applied.

Referring to FIG. 10, if the number of bands that cover a range of pixelvalues to which a band offset may be applied, from among all N bands, isn, the video encoder transmits information indicating the first band andthe last band of the n bands to the video decoder.

For example, it is assumed that a band including a pixel value of 0 inthe entire range of pixel values is a zeroth band and a band includingthe maximum pixel value in the entire range of pixel values is an(N−1)^(th) band. The video encoder may send information indicating ani^(th) band, that is, the first band, and a j^(th) band, that is, thelast band, from among the n bands that cover a range of pixel values towhich the band offset may be applied, and information about the offsetsfor the n bands to the video decoder. The video decoder receives theinformation indicating the i^(th) band and the j^(th) band and theinformation about the offsets for the n bands from the video encoder. Ifthe current picture or pixels now within the SAO application unit have apixel value corresponding to any one of the n bands, and the videodecoder may apply the band offset to each of the pixels depending on avalue of the pixel.

In the example of FIG. 10, if the entire range of pixel values is 0 to256 and the number of all the bands is 32, the video encoder mayindicate the first band and the last band of the bands that cover arange of pixel values to which the band offset may be applied, fromamong the zeroth band to the thirty-first band. If the number of bandsthat cover a range of pixel values to which the band offset may beapplied is 4 and the first band of the 4 bands is an i^(th) band and thelast band of the 4 bands is a j^(th) band, the video encoder may sendinformation indicating the i^(th) band and the j^(th) band and a bandoffset values for the i^(th), (i±1)^(th), (i+2)^(th), (i+3(=j))^(th)bands to the video decoder.

Here, the number of bands n that cover a range of pixel values to whichthe band offset may be applied might have been previously determinedbetween the video encoder and the video decoder. Furthermore, in thecase that the first band and the last band, from among the bands towhich the band offset may be applied, are indicated, the video encodermay determine a range of pixel values to which the band offset may beapplied and variably specify the number of bands to which the bandoffset may be applied.

It is assumed that the entire range of pixel values is 0 to 256, thenumber of all the bands is 32, and each of the bands have an equalinterval of 8 pixel values. If offsets are frequently applied to thepixel value ranges 32 and 160 in the current picture, bands that cover arange of pixel values to which the band offset may be applied become afourth band to a twentieth band, from among the zeroth band to thethirty-first band. The video encoder may transmit information indicatingthe first band and the last band (e.g., band_start and band_end), fromamong the bands to which the band offset may be applied, to the videodecoder. If the band offset is applied to the bands from fourth band tothe twentieth band of all the bands, information about band_start=4 andband_end=20 may be transmitted from the video encoder to the videodecoder.

In the examples of FIGS. 8 to 10, the video encoder may set theintervals of bands that cover a range of pixel values to which a bandoffset may be applied, that is, bands to which the band offset may beapplied for each SAO application unit, for each picture to which an SAOis applied, or for each slice to which the SAO is applied.

Meanwhile, the number of pixels belonging to each band, that is, thenumber of bands to which a band offset has been applied may be counted.The video encoder may send band offset values for bands having highfrequency to the video decoder.

For example, if 32 bands from a zeroth band to a thirty-first band coverthe entire range of pixel values and bands having high frequency ofapplication in the entire range of pixel values are 0, 4, 5, 6, 7, 9,12, 15, 19, 20, 23, and 25, the video encoder may send band offsetvalues for only the bands having high frequency of application to thevideo decoder, but may not send an offset value to be applied as theband offset regarding bands having low frequency of application.

In this case, the video encoder may further transmit information,indicating that offset values for what bands are transmitted, to thevideo decoder.

As the second type of the SAO, there is the edge offset in addition tothe band offset. The edge offset is applied with consideration taken ofinformation about an edge for each pixel, for example, the direction ofan edge based on the current pixel, the intensity of the current pixeland neighboring pixels, etc.

FIG. 11 shows examples of the type of representative edges that mayappear for each direction within a block. Referring to FIG. 11, FIG. 11Ashows an edge having a direction of 90 degrees, FIG. 11B shows an edgehaving a direction of 0 degree, FIG. 11C shows an edge having adirection of 45 degrees, and FIG. 11D shows an edge having a directionof 135 degrees.

An edge offset may include four types for a unit for one filtering, thatis, for the SAO application unit, according to the angle or direction ofan edge. A minimum unit of the SAO application unit may be the LargestCoding Unit (LCU). The four types in the SAO application unit, such asthat shown in FIG. 11, are hereinafter called the edge types of an edgeoffset, for convenience of description.

FIG. 12 shows four edge types of an edge offset on the basis of thecurrent pixel C. Referring to FIG. 12, FIG. 12A shows an edge type of a1-D 0 degree, FIG. 12B shows an edge type of 1-D 90 degrees, FIG. 12Cshows an edge type of 1-D 135 degrees, and FIG. 12D shows an edge typeof 1-D 45 degrees.

The edge offset may be used depending on the four edge types shown inFIG. 12.

If an edge type is determined, the edge offset is applied by taking arelation between the current pixel and neighboring pixels intoconsideration.

FIG. 13 is a diagram schematically illustrating an example in which theintensity of the current pixel is compared with the intensity of each ofneighboring pixels and the results of the comparison are classified intofour categories. Referring to FIG. 13, FIG. 13A to FIG. 13F showrelations between the current pixel C and neighboring pixels for eachcategory.

The category shown in FIG. 13A shows an example in which the intensityof each of two pixels neighboring to the current pixel C is greater thanthe intensity of the current pixel. The categories shown in FIGS. 13Band 13C show examples in each of which the intensity of one of twopixels neighboring to the current pixel is smaller than the intensity ofthe current pixel. The categories shown in FIGS. 13D and 13E showexamples in each of which the intensity of one of two pixels neighboringto the current pixel is greater than the intensity of the current pixel.The category shown in FIG. 13F shows an example in which the intensityof each of two pixels neighboring to the current pixel is smaller thanthe intensity of the current pixel.

For example, FIGS. 13A and 13F show examples in which the intensity ofthe current pixel is greater or smaller than the intensity of each ofthe neighboring pixels. Furthermore, FIGS. 13B to 13E may appear whenthe current pixel is placed at the boundary of a specific region.

Table 1 shows the four categories shown in FIG. 13.

TABLE 1 CATOGORY CONDITION 1 Intensity of C < intensity of twoneighboring pixels 2 Intensity of C < intensity of one neighboring pixel& Intensity of C = intensity of one neighboring pixel 3 Intensity of C >intensity of one neighboring pixel & Intensity of C = intensity of oneneighboring pixel 4 Intensity of C > intensity of two neighboring pixels0 Not related

In Table 1, C indicates the current pixel. The category 1 in Table 1corresponds to FIG. 13A, the category 2 in Table 1 corresponds to FIGS.13B and 13C, the category 3 in Table 1 corresponds to FIGS. 13D and 13E,and the category 4 in Table 1 corresponds to FIG. 13F.

The video encoder sends an edge offset values for each category. Thevideo decoder may reconstruct a pixel by adding an edge offset valuecorresponding to an edge type and a category for the pixel. For example,the video decoder may determine that the current pixel belongs to whichone of the four edge types of FIG. 11, then determine that the currentpixel belongs to which one of the categories of Table 1, and apply anoffset of a corresponding category to the current pixel based on thedetermination.

Meanwhile, a filtering unit, that is, a unit to which an SAO is applied(called an SAO application unit, for convenience of description) is aunit having a size equal to or greater than the Largest Coding Unit(LCU) and is aligned according to the LCU boundary.

The unit to which the SAO is applied is a region from which one pictureis split with a quad tree structure. The video encoder may determine foreach SAO application unit whether the SAO is applied or not, an offsettype, and a value of an offset and transmit the results of thedetermination to the video decoder. Here, to determine the offset typemay be to determine that which one of a plurality of band offsets andwhich one of a plurality of edge offsets will be applied. The SAOapplication unit may be separately set for a luma component and a chromacomponent, and information about the SAO application unit for the lumacomponent and the chroma component may be separately transmitted.

FIG. 14 is a diagram schematically illustrating the SAO applicationunit. In FIG. 14, the SAO application unit corresponds to a regiondemarcated by dotted lines. The example of FIG. 14 shows the SAOapplication unit in which a WQVGA (416×240) image is split in a quadtree structure. Each SAO application unit must be equal to or largerthan a minimum LCU and may be split along the boundaries of the LCUs.

As described above, the smallest unit of the SAO application unit is anLCU, but the LCU may be too large for applying a single offset accordingto a reduction in the size of a picture. For example, if the LCU is64×64, the LCU may become a too large SAO application unit inreconstructing the original picture using only a single offset.Accordingly, if two or more different edges exist within one LCU, two ormore edge offsets can be applied within one LCU.

If a plurality of edge offsets is applied within one SAO applicationunit, a plurality of edge types may be selected from the edge types ofFIGS. 12A to 12D depending on the directions of edges within a regionand then applied.

Syntax information necessary to perform the band offset and the edgeoffset of an SAO is described below.

Table 2 is a syntax structure for an SAO, and it schematically shows anexample of a sequence parameter set syntax.

TABLE 2 C Descriptor seq_parameter_set_rbsp( ) { ... sao_used_flag 1u(1) ... }

Table 2 shows an example of signaling indicating whether an SAO isapplied to the current sequence. For example, if a value ofsao_used_flag in the syntax of Table 2 is 0, it may indicate that theSAO is not used (i.e., disabled) in the current sequence. If a value ofsao_used_flag in the syntax of Table 2 is 1, it may indicate that theSAO may be used (i.e., enabled) in the current sequence.

Table 3 is a syntax structure for an SAO, and it schematically shows anexample of a slice header syntax.

TABLE 3 C Descriptor slice_header( ) { ... sao_param( ) 2 }

An SAO parameter sao_param ( ) for applying an SAO may be called in aslice header level through the slice header syntax shown in Table 3. TheSAO parameter may be set as an additional syntax set as in Table 4.

Table 4 is a syntax structure for an SAO, and it schematically shows anexample of an SAO parameter syntax.

TABLE 4 C Descriptor sao_param( ) { sao_flag 2 u(1)|ae(v) if( sao_flag ){ sao_split_param( 0, 0, 0 ) sao_offset_param( 0, 0, 0 ) } }

Parameters necessary to apply an SAO may be transmitted through the SAOparameter syntax. The transmitted parameters, as in the example of Table4, include sao_split_param for the splitting of an SAO applicationregion and sao_offset_param for an offset applied as the SAO.

In the example of Table 4, if a value of sao_flag is 1, it may indicatethat the SAO may be applied (i.e., enabled) to at least part of thecurrent picture. If a value of sao_flag is 0, it may indicate that theSAO may not be applied (i.e., disabled) to the entire current picture.Accordingly, when a value of sao_flag is 1, SAO parameters may beindicated.

Table 5 is a syntax structure for an SAO, and it schematically shows anexample of an sao_split_param syntax for splitting from among SAOparameters.

TABLE 5 C Descriptor sao_split_param( x, y, Depth ) { if( Depth <MaxSplitLevel ) split_flag[ Depth ][ y ][ x ] = sao_split_flag 2u(1)|ae(v) else split_flag[ Depth ][ y ][ x ] = 0 if( split_flag[ Depth][ y ][ x ] ) { pqao_split_param( x + 0, y + 0, Depth + 1 )pqao_split_param( x + 1, y + 0, Depth + 1 ) pqao_split_param( x + 0, y +1, Depth + 1 ) pqao_split_param( x + 1, y + 1, Depth + 1 ) } }

In the example of Table 5, sao_split_param (x, y, Depth) indicates thatinformation about whether the SAO application unit at a positionspecified by (x, y) and at a depth specified by ‘Depth’ are furthersplit is signalized through sao_split_flag. If a value of sao_split_flagis 0, it indicates that the current region is a leaf. Accordingly, thecurrent region is no longer split in order to apply an SAO. If a valueof sao_split_flag is 1, it indicates that the current region is furthersplit into four children regions. If an SAO application region is split,a split parameter pqao_split_param for the four split regions may beindicated.

The split parameter pqao_split_param indicates whether the SAOapplication unit is further split for each split region if the SAOapplication unit is further split. In a point that whether the SAOapplication unit is split at a specific depth is indicated, the syntaxsao_split_param may be used again for the split region instead of thesyntax pqao_split_param, but the depth of an indicted region may bechanged and used for a changed depth. For example, in indicating whethera region to which an SAO may be applied has been split or not, assumingthat a region, that is, the subject of indication regarding split, andthe depth thereof are (x0, y0, saoDepth), if sao_split_param (x0, y0,saoDepth) indicates that the region specified by (x0, y0) is split, thedepth of each of the split regions specified by (x0+0, y0+0), (x0+0,y0+1), (x0+1, y0+0), and (x0+1, y0+1) may be adjusted to ‘saoDepth+1’and whether a corresponding region will be split may be indicated.

Table 6 is a syntax for applying a band offset according to the presentinvention and schematically shows an example of a method of transmittinginformation about offsets for specific bands to which the band offsetmay be applied.

TABLE 6 type_idx[ Depth ][ y ][ x ] = sao_type_idx if( sao_type_idx != 0) { if( sao_type_idx = offset type is bandoffset) start_offset for( i =start_offset; i < start_offset+n−1; i++ ) offset[ Depth ][ y ][ x ][ i ]= sao_offset }

In the example of Table 6, a value of sao_type_idx indicates that whichof a band offset and an edge offset from among SAOs may be applied. Inthe example of Table 6, if a value of sao_type_idx is 0, it indicatesthat both the band offset and the edge offset may not be applied.

If a value of sao_type_idx indicates that the band offset may beapplied, the video encoder may indicate the first band, from among bandsthat cover a range of pixel values to which the band offset may beapplied, through syntax start_offset. Next, the video encoder maytransmit band offset (SAO offset) values for n bands including the firstband indicated by the syntax start_offset.

The video decoder may determine the first band, from among the bandsthat cover a range of pixel values to which the band offset may beapplied, based on information received from the video encoder and obtaininformation about the offsets for the n bands including the first band.

If a value of a pixel corresponds to any one of the n bands, the videodecoder may apply to the pixel the band offset value of thecorresponding band to which the pixel value belongs to.

Table 7 is a syntax for applying a band offset according to the presentinvention and schematically shows another example of a method oftransmitting information about offsets for specific bands to which theband offset may be applied.

TABLE 7 type_idx[ Depth ][ y ][ x ] = sao_type_idx if( sao_type_idx != 0) { if( sao_type_idx = offset type is bandoffset) end_offset for( i =end_offset−n+1; i < end_offset; i++ ) offset[ Depth ][ y ][ x ][ i ] =sao_offset }

In the example of Table 7, a value of sao_type_idx indicates that whichof a band offset and an edge offset, from among SAOs, may be applied. Ifa value of sao_type_idx is 0, it indicates that both the band offset andthe edge offset may not be applied.

If a value of sao_type_idx indicates that the band offset may beapplied, the video encoder may indicate the last band, from among thebands that cover a range of pixel values to which the band offset may beapplied, through syntax end_offset. Next, the video encoder may transmitband offset (SAO offset) values for n bands including the last bandindicated by the syntax end_offset.

The video decoder may determine the last band, from among the bands thatcover a range of pixel values to which the band offset may be applied,based on information received from the video encoder and obtaininformation about offsets for the n bands including the last band.

If a value of a pixel corresponds to any one of the n bands, the videodecoder may apply to the pixel the band offset value of thecorresponding band to which the pixel value belongs to.

Table 8 is a syntax for applying a band offset according to the presentinvention and schematically shows yet another example of a method oftransmitting information about offsets for specific bands to which theband offset may be applied.

TABLE 8 type_idx[ Depth ][ y ][ x ] = sao_type_idx if( sao_type_idx != 0) { if( sao_type_idx = offset type is bandoffset) start_offsetend_offset for( i = start_offset; i < end_offset; i++ ) offset[ Depth ][y ][ x ][ i ] = sao_offset }

In the example of Table 8, a value of sao_type_idx indicates that whichof a band offset and an edge offset, from among SAOs, may be applied. Ifa value of sao_type_idx is 0, it indicates that both the band offset andthe edge offset may not be applied.

If a value of sao_type_idx indicates that the band offset may beapplied, the video encoder may indicate the first band and the lastband, from among bands that cover a range of pixel values to which theband offset may be applied, through syntax start_offset and syntaxend_offset. Next, the video encoder may send band offset (SAO offset)values for the n bands from the first band to the last band.

The video decoder may determine the first band and the last band, fromamong the bands that cover a range of pixel values to which the bandoffset may be applied, based on information received from the videoencoder and obtain information about offsets for the n bands includingthe first band to the last band.

If a value of a pixel corresponds to any one of the n bands, the videodecoder may apply to the pixel the band offset value of thecorresponding band to which the pixel value belongs to.

As described above, if a band offset is applied, the video encoder maysend information, indicating a range of bands that cover a range ofpixel values on which the band offset may be applied to the currentpicture or the current SAO application unit, to the video decoder.Furthermore, the video encoder may send band offset values for bands,belonging to the range, to the video decoder.

The video decoder may receive the information indicating the bands towhich the band offset may be applied and the information about the bandoffsets for the bands from the video encoder. If a pixel value belongsto the bands to which the band offset may be applied, the video decodermay apply the offset value of a corresponding band to the pixel.

Table 9 schematically shows an example of syntax for performing an SAOwhen a band offset is applied according to the present invention.

TABLE 9 C Descriptor sao_offset_param ( x, y, Depth ) { if( split_flag[Depth ][ y ][ x ] ) { sao_offset_param ( x + 0, y + 0, Depth + 1 )sao_offset_param ( x + 1, y + 0, Depth + 1 ) sao_offset_param ( x + 0,y + 1, Depth + 1 ) sao_offset_param ( x + 1, y + 1, Depth + 1 ) } else {type_idx[ Depth ][ y ][ x ] = sao_type_idx 2 ue(v)|ae(v) if(sao_type_idx != 0 ) { if( sao_type_idx > 4 ) { // offset type isbandoffset start_offset end_offset } else { start_offset = 0 end_offset= PqaoOffsetNum[sao_type_idx] } for( i = start_offset; i < end_offset;i++ ) offset[ Depth ][ y ][ x ][ i ] = 2 se(v)|ae(v) sao_offset } } }

Referring to Table 9, if an SAO application region is split, an offsetparameter may be indicated for each split region.

If the SAO application region is no longer split, an offset type for theSAO application region is indicated.

In the example of Table 9, sao_type_idx indicates an offset type whichmay apply to the current region. The number of SAO offsets or the numberof SAO categories may be determined depending on the SAO typesao_type_idx applied to the current region.

In the example of Table 9, if a value of sao_type_idx is 0, it may meanthat an SAO is not applied. If a value of sao_type_idx is 1 to 4, it maymean that an edge offset is applied. The values 1 to 4 of sao_type_idxmay correspond to the four types of edge offsets shown in FIG. 12. If avalue of sao_type_idx is greater than 4, it may indicate that a bandoffset is applied. For example, when bands to which the band offset maybe applied are indicated as in Tables 6 and 7, it can be set so that anapplication of the band offset is indicated when the value ofsao_type_idx is 5. Furthermore, if the entire range of pixel values isdivided into groups each having specific bands and it is indicated thatthe current pixel or the current SAO application unit belongs to whichof the groups as described above, values of sao_type_idx greater than 4may be set to indicate a group of bands.

The example of Table 9 shows an example in which, when a band offset isapplied, bands to which the band offset may be applied are specifiedthrough start_offset and end_offset and band offset values for the bandsis transmitted.

An example of syntax information indicating the number of SAO offsets orthe number of SAO categories according to an offset type may includePqaoOffsetNum[sao_type_idx].

In the example of Table 9, start_offset may indicate a band of smallestnumber among bands to which offset may be applied or may indicate anedge type of smallest number among edge types to which offset may beapplied. That is, start_offset may indicate a band having smallest indexamong bands to which offset may be applied or may indicate an edge typehaving smallest index among edge types to which offset may be applied.If start_offset is not available, start_offset may be inferred to have avalue of 0. Furthermore, end_offset may indicate a band of largestnumber among bands to which offset may be applied or may indicate anedge type of largest number among edge types to which offset may beapplied. That is, end_offset may indicate a band having largest indexamong bands to which offset may be applied or may indicate an edge typehaving largest index among edge types to which offset may be applied. Ifend_offset is not available, a value of end_offset may be set as thenumber of SAO categories (i.e., the number of offsets), that is,PqaoOffsetNum[sao_type_idx] which is determined depending on the SAOtype sao_type_idx as described above.

Table 10 schematically shows an example of an SAO offset type. Thenumber of SAO categories (i.e., the number of offsets) may be determineddepending on an offset type as described above through Table 9.

TABLE 10 SAO TYPE INDEX NUMBER OF SAO (sao_type_idx) CATEGORY EDGE TYPE0 0 Not applied 1 4 1-D 0 degree edge 2 4 1-D 90 degrees edge 3 4 1-D135 degrees edge 4 4 1-D 45 degrees edge 5 16 Central bands 6 16 Sideband

As in Table 10, the SAO type index may indicate any one of edge offsetsand band offsets. Table 10 shows an example in which all bands aredivided into two groups so to apply a band offset. The SAO type indexindicates one of four edge offsets and two band offsets. An offset valueis set for each category constructing an SAO type. For example, in caseof an edge offset, an offset value may be set by four categoriesaccording to the intensities of the current pixel and neighboring pixelsfor each edge type.

Table 11 schematically shows an example regarding an SAO offset typewhen the number of band groups is adaptively set and a band offset isapplied.

TABLE 11 SAO TYPE INDEX NUMBER OF SAO (sao_type_idx) CATEGORY EDGE TYPE0 0 Not applied 1 4 1-D 0 degree edge 2 4 1-D 90 degrees edge 3 4 1-D135 degrees edge 4 4 1-D 45 degrees edge 5 16 Central bands 6 12 Sideband

In the example of Table 11, the number of categories in the centralgroup is different from the number of categories in the side group. Forexample, in case of 256 pixels, in Table 10, each of the central groupand the side group includes 16 groups each having 8 pixel values. Incontrast, in Table 11, a group offset is applied by using the centralgroup consisting of 16 groups each having 4 pixel values and the sidegroup consisting of 12 groups each having 16 pixel values. Accordingly,an offset may be applied to central groups more finely.

Table 12 schematically shows another example for an SAO offset type whenband groups are adaptively divided to apply a band offset.

TABLE 12 SAO TYPE INDEX NUMBER OF SAO (sao_type_idx) CATEGORY EDGE TYPE0 0 Not applied 1 4 1-D 0 degree edge 2 4 1-D 90 degrees edge 3 4 1-D135 degrees edge 4 4 1-D 45 degrees edge 5 12 Central bands 6 16 Sideband

Unlike in Table 11, Table 12 shows an example in which a side group issplit more finely to apply a band offset. For example, in Table 12, aband offset is applied by using the central group consisting of 12 bandseach having 16 pixel values and the side group consisting of 16 bandseach having 4 pixel values. Accordingly, an offset may be applied to theside bands more finely.

Table 13 shows an example of a table for an SAO type when more bandgroups are designated to apply a band offset.

TABLE 13 SAO TYPE INDEX NUMBER OF SAO (sao_type_idx) CATEGORY EDGE TYPE0 0 Not applied 1 4 1-D 0 degree edge 2 4 1-D 90 degrees edge 3 4 1-D135 degrees edge 4 4 1-D 45 degrees edge 5 8 First band group 6 8 Secondband group 7 8 Third band group 8 8 Fourth band group

In the example of Table 13, each of band groups is formed of 8 bandseach having 8 pixel values. All bands belonging to each band group maybe sequentially grouped from the left side as in FIG. 7.

Table 14 shows an example of a table for an SAO type when specific bandscovering pixel values to which a band offset may be applied is specifiedfor the band offset to apply the band offset.

TABLE 14 SAO TYPE INDEX NUMBER OF SAO (sao_type_idx) CATEGORY EDGE TYPE0 0 Not applied 1 4 1-D 0 degree edge 2 4 1-D 90 degrees edge 3 4 1-D135 degrees edge 4 4 1-D 45 degrees edge 5 8 Bands

In the example of Table 14, if a band offset is applied, the videoencoder may send a value of 5 as a value of sao_type_idx to the videodecoder. The video encoder may also specify a range of bands to whichthe band offset may be applied and send values of the band offset forthe bands of the range to the video decoder as described above.

In Tables 6 to 9, an SAO type to be applied to the current pixel, fromamong SAO types (i.e., edge types), such as those shown in Tables 10 to14, may be indicated through the above sao_type_idx. Referring to Tables10 to 14, when a value of sao_type_idx is greater than 4, a band offsetis applied as described above.

Table 15 schematically shows another example of syntax sao_offset_paramfor an offset, from among SAO parameters, as a syntax structure to whichan SAO may be applied.

TABLE 15 C Descriptor sao_offset_param ( x, y, Depth ) { if( split_flag[Depth ][ y ][ x ] ) { sao_offset_param ( x + 0, y + 0, Depth + 1 )sao_offset_param ( x + 1, y + 0, Depth + 1 ) sao_offset_param ( x + 0,y + 1, Depth + 1 ) sao_offset_param ( x + 1, y + 1, Depth + 1 ) } else {type_idx[ Depth ][ y ][ x ] = sao_type_idx 2 ue(v)|ae(v) if(sao_type_idx != 0 ) { if( sao_type_idx > 4 ) { // offset type isbandoffset total_offset_num_minus_one for( i=0;i<total_offset_num_minus_one + 1; i++) { offset_idx[i] offset[ Depth ][y ][ x ][ offset_idx[i] ] = sao_offset } } else { for( i = 0; i <PqaoOffsetNum[sao_type_idx]; i++ ) offset[ Depth ][ y ][ x ][ i ] =sao_offset 2 se(v)|ae(v) } } } }

Table 15 shows an example of the syntax structure for transmitting onlya valid band offset. Here, the valid band offset means a band offsetthat may be applicable.

Since only information about a valid band offset is transmitted,information about the number of band offsets to be applied, informationindicating a band offset, and information indicating values of offsetsneed to be transmitted.

total_offset_num_minus_one indicates the total number of offsets in aband offset. offset_idx[i] indicates that a band offset indicated bysao_type_idx corresponds to what category. sao_offset indicates anoffset value for the category indicated by offset_idx[i] in acorresponding position and depth.

As described above, a plurality of edge offsets may be applied to oneSAO application unit.

Table 16 schematically shows an example of a syntax structure when aplurality of edge offsets is applied to one SAO application unit.

TABLE 16 C Descriptor sao_offset_param ( x, y, Depth ) { if( split_flag[Depth ][ y ][ x ] ) { sao_offset_param ( x + 0, y + 0, Depth + 1 )sao_offset_param ( x + 1, y + 0, Depth + 1 ) sao_offset_param ( x + 0,y + 1, Depth + 1 ) sao_offset_param ( x + 1, y + 1, Depth + 1 ) } else {type_idx[ Depth ][ y ][ x ] = sao_type_idx 2 ue(v)|ae(v) if(sao_type_idx != 0 ) { if( sao_type_idx <5 ) {  num_edge_offset  for( k =0; k < num_edge_offset; k++ ) { for( i = 0; i < PqaoOffsetNum[sao_type_idx ]; i++ ) offset[k][ Depth ][ y ][ x ][ i ] = sao_offset  }else { for( i = 0; i < PqaoOffsetNum[ sao_type_idx ]; i++ ) offset[0][Depth ][ y ][ x ][ i ] = sao_offset 2 se(v)|ae(v)  } } } }

Referring to the examples of Table 16 and Tables 10 to 14, when a valueof sao_type_idx is smaller than 5, an edge offset is applied.num_edge_offset indicates the total number of offsets applied as theedge offsets.

Referring to Table 13, the edge offset may be applied to an SAOapplication region by as many as num_edge_offset indicates.

Meanwhile, in applying an SAO, the SAO may be applied to a chromacomponent by taking into consideration of a difference between lumacomponents and chroma components.

FIG. 4 shows local distributions of histograms for the same picture. Asdescribed above, regarding the regions A and B of FIG. 4A that are apicture of the same video, FIG. 4B shows a difference in the histogrambetween a luma original picture and a reconstructed picture.

Regarding the regions A and B of FIG. 4A, FIG. 4C shows a differencebetween a histogram for a chroma (Cr) original picture (i.e., the upperand lower sides on the left side of FIG. 4C) and a histogram for thereconstructed picture (i.e., the upper and lower sides on the right sideof FIG. 4C).

Furthermore, FIG. 4D shows a difference between a histogram for thechroma (Cb) original picture (i.e., the upper and lower sides on theleft side of FIG. 4D) and a histogram for the reconstructed picture(i.e., the upper and lower sides on the right side of FIG. 4D).

From FIG. 4, it can be seen that there is a difference in the picturecharacteristics between luma and chroma for the same picture. For thisreason, not only the offset of a signal for luma pixels, but also theoffset of a signal for chroma pixels may be independently transmitted.Here, the offset may be applied to the chroma pixels by taking thenumber of luma pixels and the number of chroma pixels intoconsideration.

For example, if a range of the chroma signal, that is, a range of pixelvalues of the chroma pixels is 0 to 2^(N)−1 (N is a bit depth of a pixelvalue), the size of the entire bit depth, that is, the range of pixelvalues may be divided as in the example of FIG. 15 or 16.

FIG. 15 is a diagram schematically illustrating examples in which a bandoffset is applied to only some of all bands for chroma pixels.

Referring to FIG. 15, chroma pixels may be allocated to a central bandscomposed of K bands in the center of all 2*K bands, and a band offsetmay be applied.

An offset value for indices 1, 2, . . . , K allocated to respectivebands to which the band offset may be applied may be transferred fromthe video encoder to the video decoder. Regarding an offset value forindices allocated to side bands to which the band offset is not applied,the indices may be designated as 0 so that an offset for chroma pixelsis not indicated. An index having a value of 0 may indicate that theband offset may not be applied or may indicate that the offset value ofthe band offset is 0.

FIG. 16 is a diagram schematically illustrating another example in whicha band offset is applied to only some of all bands for chroma pixels.

Referring to FIG. 16, chroma pixels may be applied to the remainingbands composed of side K bands of all 2*K bands, and a band offset maybe applied.

An offset value for indices 1, 2, . . . , K/2, K/2+1, . . . , Kallocated to respective bands to which the band offset may be appliedmay be transferred from the video encoder to the video decoder.Regarding an offset value for indices allocated to central bands towhich the band offset is not applied, the indices may be designated as 0so that an offset for chroma pixels is not indicated. An index having avalue of 0 may indicate that the band offset may not be applied or mayindicate that the offset value of the band offset is 0.

In the examples of FIGS. 15 and 16, assuming that K is set to a value of16, the entire range of pixel values may be divided into 32 bands, the32 bands may be divided into 2 groups, that is, 16 bands of a centralpart and 16 bands of side parts to apply a band offset.

As compared with a signal for luma pixels (i.e., a pixel value), K maybe set to 8 (i.e., K=8) by reducing the number of all bands withconsideration taken of a small variance in a signal for chroma pixels(i.e., a pixel value). When K=8, the number of all bands to apply a bandoffset is 16. A band offset for the chroma pixels can be applied with 8central part bands and 8 side part bands. Here, a signal for luma pixels(i.e., a luma signal) is a pixel value (e.g., intensity) of a lumapixel, which is hereinafter referred to as a ‘luma signal’, forconvenience of description.

Table 17 shows a syntax structure for independently applying an SAO tochroma and schematically shows an example of syntax sao_offset_paramregarding an offset, from among SAO parameters.

TABLE 17 C Descriptor sao_offset_param ( x, y, Depth ) { if( split_flag[Depth ][ y ][ x ] ) { sao_offset_param ( x + 0, y + 0, Depth + 1 )sao_offset_param ( x + 1, y + 0, Depth + 1 ) sao_offset_param ( x + 0,y + 1, Depth + 1 ) sao_offset_param ( x + 1, y + 1, Depth + 1 ) } else {type_idx[ Depth ][ y ][ x ] = sao_type_idx 2 ue(v)|ae(v) if(sao_type_idx != 0 ) { for( i = 0; i < PqaoOffsetNum[ sao_type_idx ]; i++) offset[ Depth ][ y ][ x ][ i ] = sao_offset 2 se(v)|ae(v) type_idx[Depth ][ y ][ x ] = sao_type_cr_idx if( sao_type_cr_idx != 0 ) { for( i= 0; i < PqaoOffsetNum[ sao_type_cr_idx ]; i++ ) offset[ Depth ][ y ][ x][ i ] = sao_cr_offset } type idx[ Depth ][ y ][ x ] = sao_type_cb_idxif( sao_type_cb_idx != 0 ) { for( i = 0; i < PqaoOffsetNum[sao_type_cb_idx ]; i++ ) offset[ Depth ][ y ][ x ][ i ] = sao_cb_offset} } } }

Referring to Table 17, sao_type_cr_idx indicates an offset type for achroma (Cr) signal. Furthermore, sao_type_cb_idx indicates an offsettype for a chroma (Cb) signal. sao_cr_offset indicates an offset valuefor a chroma (Cr) signal. sao_cb_offset indicates an offset value for achroma (Cb) signal.

In the example of Table 17, when an offset type applied to a chroma (Cr)signal is indicated by sao_type_cr_idx, an offset value indicated bysao_cr_offset may be applied to the current pixel. Furthermore, when anoffset type applied to a chroma (Cb) signal is indicated bysao_type_cb_idx, an offset value indicated by sao_cb_offset may beapplied to the current pixel.

FIG. 17 is a flowchart schematically illustrating the operation of thevideo encoder in a system to which the present invention is applied.

Referring to FIG. 17, the video encoder reconstructs a block at stepS1710. The video encoder can generates a reconstructed residual blockthrough dequantization and an inverse transform after performingquantization and transform on a residual a residual block generatedbased on a prediction block and the current block.

Next, the video encoder applies an in-loop filter to reconstructedblocks at step S172. The in-loop filter may be applied in the filtermodule of FIG. 1, and at least one of a deblocking filter, an SAO, andan ALF may be used as the in-loop filter. Here, the SAO may be appliedto a picture to which the deblocking filter has been applied, per pixel.The SAO may be applied to the reconstructed blocks for each SAOapplication unit. The ALF may be applied after the SAO is applied.

If the SAO is applied, the filter module may apply an offset per a pixelunit. Here, the filter module may adaptively determine the number ofoffsets (i.e., the number of bands) for applying a band offset and agroup of the bands and may send only an offset for valid bands (bandsthat cover a range of pixel values to which the band offset may beapplied) to the video decoder. Furthermore, the filter module may applya plurality of edge offsets within an SAO application region. Thedetails have been described above.

Furthermore, the filter module may apply an SAO to chroma pixels. Aregion to which the SAO may be applied may be independently defined incases of luma and chroma. Furthermore, in case of a band offset forchroma, the number of bands and a group may be determined in order toapply an offset to chroma pixels. The details have been described above.

Next, the video encoder may send a bitstream, including videoinformation about a picture to which the SAO, etc. is applied and videoinformation about the SAO, to the video decoder at step S1730. Here, thevideo encoder may perform processes, such as a transform, quantization,re-arrangement, and entropy coding, in order to transmit the pieces ofinformation. If a band offset is applied, the video encoder may sendinformation indicating bands that cover a range of pixel values to whichthe band offset may be applied and band offset values for the bands.

FIG. 18 is a flowchart schematically illustrating the operation of thevideo decoder in a system to which the present invention is applied.

Referring to FIG. 18, the video decoder receives a bitstream from thevideo encoder at step S1810. The received bitstream includes not onlyinformation about a picture, but also other information necessary toreconstruct the video information.

The video decoder reconstructs a block based on the pieces of receivedinformation at step S1820. The video decoder generates a reconstructedblock on the basis of a prediction block generated based on predictionand a residual block generated through dequantization and an inversetransform. In order to generate the residual block, the video decodermay perform entropy decoding and re-arrangement before performing thedequantization and inverse transform.

The video decoder applies an in-loop filter to the reconstructed blockat step S1830. The in-loop filtering may be used in the filter module ofFIG. 2. At least one of deblocking filter, an SAO, and an ALF may beused in the filter module. Here, the SAO may be applied to a picture bya pixel unit, to which the deblocking filter has been applied. The SAOmay be applied to the reconstructed blocks for each SAO applicationunit. The ALF may be applied to a picture to which the SAO has beenapplied.

When the SAO is applied, the filter module may apply an offset to eachpixel. Here, the filter module may derive SAO parameters on the basis ofsyntax elements received from the video encoder. The filter module mayapply a band offset to the current pixel on the basis of the number ofoffsets (i.e., the number of bands) and a group of the bands which areindicated by information about the application of the SAO, such as theSAO parameters. Here, information about an offset for valid bands (i.e.,bands that cover a pixel range to which a band offset will be applied)only may be transmitted to the video decoder. Furthermore, the filtermodule may apply a plurality of edge offsets within a corresponding SAOapplication region based on indication of the SAO parameters. Thedetailed description has been given above.

Furthermore, the filter module may apply the SAO to chroma pixels.Regions to which the SAO may be applied may be independently defined incases of luma and chroma, and related information may be received fromthe video encoder. Furthermore, information about the number of bandsand a group of the bands for applying a band offset to chroma pixels maybe received from the video encoder. The video decoder may perform theSAO on the chroma pixels on the basis of the received information. Thedetailed description has been given above.

In the above description, the terms a ‘pixel value’ and the ‘intensityof a pixel’ have been used interchangeably in order to clarify thecharacteristics of the invention, but the two terms may be interpretedas having the same meaning or the term the ‘pixel value’ may beinterpreted as having a meaning including the ‘intensity of a pixel’.Furthermore, regarding a unit region to which an SAO is applied, thefiltering unit and the SAO application unit have been usedinterchangeably for convenience of description, but it is to be notedthat they may be interpreted as having the same meaning. In the aboveexemplary systems, although the methods have been described on the basisof the flowcharts using a series of the steps or blocks, the presentinvention is not limited to the sequence of the steps, and some of thesteps may be performed at different sequences from the remaining stepsor may be performed simultaneously with the remaining steps.Furthermore, the above-described embodiments include various aspects ofexamples. Accordingly, the present invention should be construed toinclude all other alternations, modifications, and changes which fallwithin the scope of the claims.

In the description regarding the present invention, when it is said thatone element is “connected” or “coupled” to the other element, the oneelement may be directly connected or coupled to the other element, butit should be understood that a third element may exist between the twoelements. In contrast, when it is said that one element is “directlyconnected” or “directly coupled” to the other element, it should beunderstood that a third element does not exist between the two elements.

1. (canceled)
 2. A video encoding method performed by a video encodingapparatus, the method comprising: generating a prediction sample in acurrent picture based on intra prediction or inter prediction;generating a reconstructed picture based on the prediction sample;applying a deblocking filtering process to the reconstructed picture;applying a sample adaptive offset (SAO) process to a sample in thereconstructed picture after completing the deblocking filtering process;and encoding video information to generate a bitstream, wherein thevideo information includes prediction information on the predictionsample and offset information on the SAO process, wherein the offsetinformation includes flag information about whether the SAO process isenabled to the sample, and wherein the offset information includes bandinformation indicating one of 32 bands as a starting band of a bandgroup consisting of consecutive n bands among the 32 bands, an offsetfor a band among the n bands is applied to the sample, wherein n is apositive integer.
 3. The method of claim 2, wherein the offsetinformation includes type information for specifying an offset type forthe sample as a band offset type.
 4. The method of claim 3, wherein thetype information is encoded based on entropy encoding using acontext-adaptive arithmetic coding.
 5. The method of claim 2, whereinthe offset information includes offset information for a magnitude ofthe offset applied to the sample.
 6. The method of claim 5, wherein theoffset information for the magnitude is encoded based on entropyencoding using a context-adaptive arithmetic coding.
 7. The method ofclaim 2, wherein the band is determined as a predetermined sample valuerange to which the sample belongs.
 8. The method of claim 2, wherein then is determined as a constant number.
 9. The method of claim 2, whereinthe band information further indicates one of the 32 bands as an endingband of the band group, the consecutive n bands are determined based onthe starting bands and the ending band.
 10. The method of claim 2,wherein the 32 bands are sections into which the whole sample valueregions are divided with a constant size.
 11. A non-transitorydecoder-readable storage medium storing a bitstream generated byperforming generating a prediction sample in a current picture based onintra prediction or inter prediction, generating a reconstructed picturebased on the prediction sample, applying a deblocking filtering processto the reconstructed picture, applying a sample adaptive offset (SAO)process to a sample in the reconstructed picture after completing thedeblocking filtering process, and encoding video information to generatethe bitstream, wherein the video information includes predictioninformation on the prediction sample and offset information on the SAOprocess, wherein the offset information includes flag information aboutwhether the SAO process is enabled to the sample, wherein the offsetinformation includes band information indicating one of 32 bands as astarting band of a band group consisting of consecutive n bands amongthe 32 bands, an offset for a band among the n bands is applied to thesample, wherein n is a positive integer.